<?php
class MY_Controller extends MX_Controller
{
	function __construct($module_id=null)
	{
		parent::__construct();	
		
		// Settings
		$this->load->library('Cconfig');	
	
		// Customer
		$this->load->library('Customer');
		/*	
		// Log
		$this->load->library('Log', array('filename' => $this->cconfig->get('config_error_filename')));
		
		//Language		
		if (($this->input->server('REQUEST_METHOD') == 'POST') && $this->input->post('language_code')) {
				$this->session->set_userdata('language_code', $this->input->post('language_code'));
				
				
			
				if ($this->input->post('redirect')) {
					redirect($this->input->post('redirect'));
				} else {
					redirect(site_url().'/common/home');
				}
		}		
							
		if($this->session->userdata('language_code') == '')
		{
			
			if($this->cconfig->get('config_language') == "en")
			{
				$this->session->set_userdata('language_code', 'english');		
			}
			else
			{
				$this->session->set_userdata('language_code', $this->cconfig->get('config_language'));		
			}
			
			
		}	
		
		if($this->session->userdata('language_code') == 'en')
		{
			$this->session->set_userdata('language_code', 'english');		
		}
		//$this->session->set_userdata('language_code', 'zh-HK');
	
		$this->config->set_item('language', $this->session->userdata('language_code'));
		
		$this->load->model('localisation/Model_Language');
		
		if($this->session->userdata('language_code') == "english")
		{
			$lang_id = 	$this->Model_Language->getLanguageID('en');
		}
		else
		{
			$lang_id = $this->Model_Language->getLanguageID($this->session->userdata('language_code'));
		}
		
		$this->cconfig->set('config_language_id', $lang_id);	
		$this->lang->load($this->session->userdata('language_code'));
		
		// Currency
		$this->load->library('Currency');
		
		// Tax
		$this->load->library('Tax');
		
		// Weight
		$this->load->library('Weight');
		
		// Cart
		$this->load->library('Hkcart');
		
		// Mail
		$this->load->library('Hmail');
		*/
	}
}
?>